﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TinhToHop
{
    class Program
    {
        public int GT(int n)
        {
            int tg=1;
            for(int i=1; i<n; i++)
                tg*=i;
            return tg;
        } //ham tinh giai thua
        public float ToHop(int n, int k)
        {
            Program pr = new Program();
            float th = (float)pr.GT(n)/(pr.GT(n-k)*pr.GT(k));
            return th;
        } //ham tinh to hop chap k cua n
        static void Main(string[] args)
        {
            int n, k;
            Console.WriteLine("nhap so nguyen duong n va k (k<n)");
            Console.WriteLine("n= ");
            n = Convert.ToInt32(Console.ReadLine());
            Console.WriteLine("k= ");
            k = Convert.ToInt32(Console.ReadLine());
            //goi ham
            Program pr= new Program();
            Console.WriteLine("to hop chap k cua n = " + pr.ToHop(n, k));
            Console.ReadLine();
        }
    }
}
